<?php

$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
/**
* Adding Different Attributes
*/
// adding attribute group
$setup->addAttributeGroup('catalog_product', 'Default', 'Is Featured', 1000);

// the attribute added will be displayed under the group/tab Special Attributes in product edit page
	$setup->addAttribute('catalog_product', 'is_feature', array(
	'group' 			=> 'General',
	'input' 			=> 'select',
	'type' 				=> 'text',
	'backend'           => '',
    'frontend'          => '',
	'label' 			=> 'Is Featured',
	'source'			=>'relatedproduct/catalog_product_attribute_source_isfeatured',
	'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
	'visible'           => true,
	'required'          => false,
	'user_defined'      => false,
	'default'           => 0,
	'searchable'        => false,
	'filterable'        => false,
	'comparable'        => false,
	'visible_on_front'  => false,
	'unique'            => false,
	));
$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('relatedproduct')};
CREATE TABLE {$this->getTable('relatedproduct')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `type` varchar(126) NOT NULL default '',
  `product_ids` varchar(500) NOT NULL default '',
  `group_customer` varchar(500) NOT NULL default '',
  `number_product` int(6) NOT NULL default '0',
  `random` smallint(6) NOT NULL default '1',
  `position` varchar(126) NOT NULL default '',
  `priority` int(6) NOT NULL default '0',
  `stores` int(6) NOT NULL default '0',
  `date_start` date default '0000-00-00',
  `date_expire` date default '0000-00-00',
  `status` smallint(6) NOT NULL default '0',
  `created_time` datetime NULL,
  `update_time` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    ");
	/*
$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('categoryblock_condition')};
CREATE TABLE {$this->getTable('categoryblock_condition')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `block_id` int(11) NOT NULL,
  `current_category` text NOT NULL default '',
  `conditions_serialized` text NOT NULL default '',
  `general_serialized` text NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");
$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('productblock_condition')};
CREATE TABLE {$this->getTable('productblock_condition')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `block_id` int(11) NOT NULL,
  `current_product` text NOT NULL default '',
  `conditions_serialized` text NOT NULL default '',
  `general_serialized` text NOT NULL default '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");
*/
$installer->endSetup(); 